This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Improve informational printouts in update-all and update#37
Merged
Conversation
08d9f47 to
b35e365
Compare
derrickstolee
approved these changes
Mar 23, 2023
Collaborator
derrickstolee
left a comment
There was a problem hiding this comment.
Excellent. Thanks for the fast turnaround here. Nice to see your investment in these interfaces paying off.
Comment on lines
56
to
67
| subargs[1] = route | ||
| cmd := exec.Command(exe, subargs...) | ||
| cmd.Stderr = os.Stderr | ||
| cmd.Stdout = os.Stdout | ||
|
|
||
| err := cmd.Start() | ||
| if err != nil { | ||
| return u.logger.Errorf(ctx, "git command failed to start: %w", err) | ||
| } | ||
|
|
||
| err = cmd.Wait() | ||
| exitCode, err := commandExecutor.RunStdout(ctx, exe, subargs...) | ||
| if err != nil { | ||
| return u.logger.Errorf(ctx, "git command returned a failure: %w", err) | ||
| return u.logger.Error(ctx, err) | ||
| } else if exitCode != 0 { | ||
| return u.logger.Errorf(ctx, "git-bundle-server update exited with status %d", exitCode) | ||
| } | ||
| fmt.Print("\n") | ||
| } | ||
|
|
||
| return nil |
Collaborator
There was a problem hiding this comment.
As a bonus, the refactored code is much clearer about what is happening.
Update 'update-all.go' to use 'common.FileSystem' to get the path to the 'git-bundle-server' executable, and use 'cmd.CommandExecutor' to call 'git-bundle-server update'. The use of the common structures eliminate some duplicate code as well as set up the command to be unit testable in the future. Signed-off-by: Victoria Dye <vdye@github.com>
Add and update informational printouts in 'git-bundle-server update' to inform users more accurately of which step is in progress, as well as clearly indicate when the update stops early due to a lack of updates from the remote. Also add a printout to 'update-all' indicating which route is being updated at a given time as it loops through all routes. Signed-off-by: Victoria Dye <vdye@github.com>
b35e365 to
ff93dbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #35
This pull request is a fairly light refactor of
update-all.go(replacing direct usage of theexeccore library withcmd.CommandExecutor) + some slightly more informative logging in bothupdate-allandupdate.